<template>
  <footer>
    <el-button type="primary" :icon="Back" text link size="large"
      :style="{ visibility: props.mainstep == 0 ? 'hidden' : 'visible' }" @click="preStep">上一步</el-button>
    <el-button type="primary" @click="oldStep">下一步</el-button>
  </footer>
</template>

<script setup lang="ts">
import { Back } from '@element-plus/icons-vue'
const props = defineProps<{ mainstep: number }>()
const emits = defineEmits(["update:mainstep", "submit"])

function preStep() {
  if (props.mainstep == 0) return;
  emits("update:mainstep", props.mainstep - 1)
}

function oldStep() {
  emits("submit")

}





</script>

<style lang="scss" scoped>
footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  border-top: 1px solid #eee;
  box-sizing: border-box;

  .el-button {
    font-weight: bold;
  }


}
</style>